package com.b2b.purchase.mb;

import java.io.File;
import java.io.IOException;

import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;

public class UploadFileMB {

	public void fileUploadListener(UploadEvent event) throws IOException {
		int i;
		//try{
			UploadItem item = event.getUploadItem();  
			
			String name = "unnamed_attachment";
						
			File srcFile=item.getFile();
			name = srcFile.getName();
			byte[] data = item.getData();

			
			System.out.println("Success!!!");
			
		//}catch(Exception e){
			
			//System.out.println("ERROR!!!");
		//}
		
	}
}
